#include<iostream>
#include<vector>
#include<unordered_map>

using namespace std;

/**/

int findSpecialInteger(vector<int>& arr) {
    unordered_map<int, int>cnt;
    int n = arr.size();
    for (auto x : arr)
    {
        cnt[x]++;
        if (cnt[x] > n / 4)
            return x;
    }
    return -1;
}

int main()
{
    vector<int> arr = { 1,2,2,6,6,6,6,7,10 };
    cout << findSpecialInteger(arr) << endl;
    return 0;
}